#include <Poco/Foundation.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/Net/HTMLForm.h>
#include <Poco/StreamCopier.h>
#include <Poco/Net/HTTPClientSession.h>
#include <iostream>

int main(int argc, char* argv[])
{
	//http://124.232.147.35:8033/WebServiceTSPort.asmx/SelectQCMThreeStatistics', 'POST', 'dateTime=%s' % createDate)
	using namespace Poco::Net;
	//HTTPClientSession s("www.baidu.com");
	HTTPClientSession s("124.232.147.35", 8033U);
	//s.setProxy("localhost", srv.port());
	HTTPRequest request(HTTPRequest::HTTP_POST, "/WebServiceTSPort.asmx/SelectQCMThreeStatistics");
	//HTTPRequest request(HTTPRequest::HTTP_GET, "/");
	HTMLForm form;
	form.add("dateTime", "2016-09-26");
	form.prepareSubmit(request);
	s.setKeepAliveTimeout(60000000);
	s.setTimeout(60000000);
	s.sendRequest(request);
	HTTPResponse response;
	std::istream& rs = s.receiveResponse(response);
	Poco::StreamCopier::copyStream(rs, std::cout);

	return 0;
}